//
//  XLEditorHeadViewCell.m
//  XiangLove
//
//  Created by feng song on 2017/11/29.
//  Copyright © 2017年 BAOMIHUA.COM. All rights reserved.
//

#import "XLEditorHeadViewCell.h"
#define leftX 15

@implementation XLEditorHeadViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self addheaderView];
    }
    return self;
}

- (void)addheaderView {
    
    self.headerImageview = [[UIImageView alloc]init];
    _headerImageview.backgroundColor = kWhiteColor;
    _headerImageview.layer.masksToBounds = YES;
    _headerImageview.layer.cornerRadius = 30;
    [_headerImageview sd_setImageWithURL:nil placeholderImage:[UIImage imageNamed:@"datu"]];
    
    [self.contentView addSubview:_headerImageview];
    [_headerImageview mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).with.offset(-15);
        make.size.mas_equalTo(CGSizeMake(60, 60));
        make.centerY.mas_equalTo(self.contentView);
    }];
    
    self.headerLabel = [[UILabel alloc] init];
    self.headerLabel.textColor = [UIColor blackColor];
    _headerLabel.font = [UIFont systemFontOfSize:16.0f];
    [self.contentView addSubview:_headerLabel];
    [_headerLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).with.offset(leftX);
        make.centerY.mas_equalTo(self.contentView);
    }];
    
    //    self.headerImageview = [[UIImageView alloc]init];
    //    _headerImageview.backgroundColor = qianGrayColor;
    //    _headerImageview.layer.masksToBounds = YES;
    //    _headerImageview.layer.cornerRadius = 40;
    //    _headerImageview.image = [UIImage imageNamed:@"userInfo_headimge"];
    //    [self.contentView addSubview:_headerImageview];
    //    [_headerImageview mas_makeConstraints:^(MASConstraintMaker *make) {
    //        make.top.equalTo(self.contentView.mas_top).with.offset(20);
    //        make.height.mas_equalTo(@80);
    //        make.width.mas_equalTo(@80);
    //        make.centerX.mas_equalTo(self.contentView);
    //    }];
    //
    //    self.headerLabel = [[UILabel alloc] init];
    //    _headerLabel.font = [UIFont systemFontOfSize:15.0f];
    //    _headerLabel.text = @"编辑头像";
    //    _headerLabel.textColor = RGB(141, 141, 142);
    //    _headerLabel.textAlignment = NSTextAlignmentCenter;
    //    [self.contentView addSubview:_headerLabel];
    //    [_headerLabel mas_makeConstraints:^(MASConstraintMaker *make) {
    //        make.top.equalTo(_headerImageview.mas_bottom).with.offset(10);
    //        make.height.mas_equalTo(@20);
    //        make.centerX.mas_equalTo(self.contentView);
    //    }];
    
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
